<!-- 
    类似于数组，但是成员的值是唯一的，没有重复的值
    搜索关键字
    Set本身是一个构造函数，用来生成Set构造函数
 -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const s1 = new Set(); //空的Set结构
        console.log(s1.size);

        const s2 = new Set(["a", "b"]);
        console.log(s2.size);  //结果是2

        //利用set数据结构做数组去重
        const s3 = new Set(["a", "a", "b", "b"]);
        console.log(s3.size);//结果是2

        const ary = [...s3];
        console.log(ary);
    </script>
</body>

</html>